/*
 * @Descripttion: 出手鸭小程序
 * @version:1.0.1 
 * @Author: HHL
 * @Date: 2022-11-16 17:55:54
 * @LastEditTime: 2025-07-25 21:46:35
 * @LastEditors: sueRimn
 */

// 小程序发布要修改环境
// let env = 'dev'
let env = 'prod'



// console.log("--",env)
// console.log("--",process.env.NODE_ENV)

let _BASEHOST = ''
let _OSSHOST = 'https://image.chushouya.com'
let _SETTING_HOST = uni.getStorageSync("setting_host") || "";


// #ifdef H5
_BASEHOST = ''
// #endif

// #ifndef H5
if (process.env.NODE_ENV === 'production') {
  _BASEHOST = 'https://api.chushouya.com'
} else {
  if (env === 'prod') {
    _BASEHOST = 'https://api.chushouya.com'
  } else if (env === 'dev') {
    _BASEHOST = 'https://api.chushouya.com'
  }
}
if(_SETTING_HOST){
  _BASEHOST = _SETTING_HOST
}
// #endif

export const BASEHOST = _BASEHOST
export const OSSHOST = _OSSHOST


// 平台对应信息
const returnPlatformInfo = () => {
  // #ifdef H5
  return {
    appid: '100003',
    platform: 'h5',
    appKey: 'c3acbd1405b9ef62',
    partnerId: '100003',
    refererText: 'h5 小程序'
  }
  // #endif

  // #ifdef MP-ALIPAY
  return {
    appid: '2021005164642400',
    platform: 'MP-ALIPAY',
    appKey: 'B813658B7016F421D7F410',
    partnerId: '100002',
    refererText: '支付宝小程序'
  }
  // #endif
  // #ifdef MP-WEIXIN
  return {
    appid: 'wxfb9f57d8a7f79950',
    platform: 'MP-WEIXIN',
    appKey: 'mHjeafS8mOWMluadg+',
    partnerId: '100001',
    refererText: '微信小程序'
  }
  // #endif

    // #ifdef MP-XHS
  return {
    appid: '68edfc1e639f8e00019558c1',
    platform: 'MP-XHS',
    appKey: 'mHjeafS8mOWMluadg+',
    partnerId: '100002',
    refererText: '小红书小程序'
  }
  // #endif
  return {}
}

export const appid = returnPlatformInfo()['appid']
export const appKey = returnPlatformInfo()['appKey']
export const platform = returnPlatformInfo()['platform']
export const refererText = returnPlatformInfo()['refererText']
export const partnerId = returnPlatformInfo()['partnerId']

